cmake_minimum_required(VERSION 3.0.2)
project(add_timestamp)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)

#add_definitions(-std=c++11)

set(CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS, "${CXX_FLAGS}")


## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
        pcl_ros
        roscpp
        rospy
        std_msgs

        pcl_conversions
        sensor_msgs
        visualization_msgs
        pcl_conversions
        sensor_msgs
        )


set(ALL_TARGET_LIBRARIES "")
include(cmake/eigen.cmake)

include(cmake/PCL.cmake)




catkin_package(
        #  INCLUDE_DIRS include
        #  LIBRARIES add_timestamp
        #  CATKIN_DEPENDS pcl_ros roscpp rospy std_msg
        #  DEPENDS system_lib
)


## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
        # include
        ${PROJECT_SOURCE_DIR}
        ${PROJECT_SOURCE_DIR}/include
        ${catkin_INCLUDE_DIRS}
)

find_package(PCL REQUIRED )
find_package (Eigen3 )
#find_package(PCL 1.8.1)
#list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")

include_directories(${PCL_INCLUDE_DIRS})


include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")


file(GLOB_RECURSE ALL_SRCS "src/*.cpp")
file(GLOB_RECURSE NODE_SRCS "nodecpp/add_timestamp.cpp")
#file(GLOB_RECURSE THIRD_PARTY_SRCS "Thirdparty/*.cpp")
list(REMOVE_ITEM ALL_SRCS ${NODE_SRCS})
#list(REMOVE_ITEM ALL_SRCS ${THIRD_PARTY_SRCS})


#add_executable(add_timestamp nodecpp/add_timestamp.cpp ${ALL_SRCS})
#add_executable(add_timestamp nodecpp/add_timestamp.cpp src/processPointClouds.cpp src/render/render.cpp)
add_executable(add_timestamp nodecpp/add_timestamp.cpp )

#target_link_libraries(add_timestamp ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES})
target_link_libraries(add_timestamp ${catkin_LIBRARIES} ${PCL_LIBRARIES})

